<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 Strict//EN" "http://www.w3.org/tr/xhtml1/Dtd/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>后台主界面</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href='<?php echo $static_url; ?>common/css/admin.css' type="text/css" />
<script src="<?php echo $static_url; ?>common/js/jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="<?php echo $static_url; ?>common/js/common.js" type="text/javascript"></script>

<script src="<?php echo $static_url; ?>common/js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<link rel="stylesheet" href='<?php echo $static_url; ?>common/css/daily_record.css' type="text/css" />
<link rel="stylesheet" href='<?php echo $static_url; ?>common/css/news_add.css' type="text/css" />
<script src="<?php echo $static_url; ?>ueditor/ueditor.config.js" type="text/javascript"></script>
<script src="<?php echo $static_url; ?>ueditor/ueditor.all.js" type="text/javascript"></script>
</head>
<body class="body_background">
	<div>
		<?php echo $header_nav; ?>
		<div class="common_container clearfix">
			<div class="crumbs">
				<span class="catalogue">名人</span>
				<a href="/www/admin/star/star_lists.php">名人列表</a> |
				<a href="/www/admin/star/star_add.php">添加名人</a> |
				<a onclick="add_empty();" href="javascript:;">添加空白档</a> | 
				<a href="/www/admin/star/star_recover.php">回收站</a> |
				<a href="/www/admin/star/star_search.php">搜索名人</a>
			</div>
			<div class="daily_record_menu" id="side_container">
				<div class="closeSidebar"><i title="点击隐藏左菜单" class="icon_close"></i></div>
				<ul class="record_menu">
					<li style="font-size:14px;">名人</li>
					<li><a href="/www/admin/star/star_lists.php"> └ 名人列表</a></li>
					<li><a href="/www/admin/star/star_add.php"> └ 添加名人</a></li>
					<li><a onclick="add_empty();" href="javascript:;"> └ 添加空白档</a></li>
					<li><a href="/www/admin/star/star_recover.php"> └ 回收站</a></li>
					<li><a href="/www/admin/star/star_search.php"> └ 搜索名人</a></li>
				</ul>
			</div>
			<div class="sidebar_container_hidden" style="margin-top:10px;margin-right:5px;" >
				<div class="openSidebar"><i title="点击显示左菜单" class="icon_open"></i></div>
			</div>
			<div class="daily_record_main">
				<div class="news_add_container" id="main_container">
					<table class="record_tips"><tr><td class="colorstyle">添加名人</td></tr></table>
					<form name="myform" id="myform" action="/www/admin/star/do/do_add.php" method="post" enctype="multipart/form-data" onsubmit="return do_submit();">
						<table class="news_add_table" border="0" cellSpacing="0" width="100%">
							<tbody>
								<tr>
									<td class="tleft w100"><span style="color:#f00;">*</span><span class="fontWeight">姓名</span></td>
									<td><input name="title" id="title" style="height:25px;width:200px;" /></td>
								</tr>
								<tr>
									<td class="tleft w100"><span class="fontWeight">新闻站头像</span> </td>
									<td><input type="file" name="attach[news]" />(65*60)</td>
								</tr>
								<tr>
									<td class="tleft w100"><span class="fontWeight">名人榜头像</span> </td>
									<td><input type="file" name="attach[star]" />(90*120)</td>
								</tr>
								<tr>
									<td class="tleft w100"><span class="fontWeight">内容</span></td>
									<td><textarea name="content" style="width:800px;" id="content" boxid="content"></textarea></td>
								</tr>
								<tr>
									<td class="tleft w100"><span class="fontWeight">附件</span></td>
									<td><input type="file" name="attachment[attachment]" /></td>
								</tr>
								<tr>
									<td class="tleft w100"><span class="fontWeight"><font color="red">插入HTML时<br/>需要加入<br/>统计代码</font></span></td>
									<td>
									<textarea style="width:800px;height:180px;" readonly="readonly"><!--百度统计-->
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F5bfe7a3cb13ab6cf2ea9b9a63d61924a' type='text/javascript'%3E%3C/script%3E"));
</script>
<!--点击量统计-->
<script src="/js/jquery.js" type="text/javascript"></script>
<script src="/s_api/update_click.php?pw=zgqw2013" type="text/javascript"></script></textarea>
									</td>
								</tr>
								<tr>
									<td class="tleft w100"><span class="fontWeight">HTML</span></td>
								  <td><textarea name="html" id="html" style="width:800px;min-height:400px;"></textarea></td>
								</tr>
								<tr>
									<td class="tleft w100">&nbsp;</td>
									<td>
										<label>&nbsp;&nbsp;&nbsp;&nbsp;
											<input type="checkbox" value="2" name="index_top">首页置顶(在新闻站首页展示)
										</label>&nbsp;&nbsp;&nbsp;&nbsp;
										<span>排序</span>
										<input style="height:25px;width:50px;" type="text" name="orders"/>
									</td>
								</tr>
								<tr>
									<td class="tleft w100">&nbsp;</td>
									<td>
										<input type="submit" class="btn" name="submit" value="提交">
									</td>
								</tr>									
							</tbody>
						</table>
					</form>
				</div>
			</div>
		</div>
	</div>
<script type="text/javascript">
//实例化编辑器
var editor = new UE.ui.Editor();
editor.render("content");

function do_submit(){
	if( $('#title').val() == '' ){
		alert('请填写姓名');
		$('#title').focus();
		return false;
	}else if( $('#html').val() == '' && editor.hasContents() == false ){
		alert('HTML和内容两个不能同时为空');
		return false;
	}else{
		return true;
	}
}

//添加空白档
function add_empty(){
	$.ajax({
		type: "POST",
		url: "/admin/star/ajax/ajax_add_empty.php",
		dataType:'json',
		success: function(msg){
			alert(msg.string);
			window.location.href="/www/admin/star/star_lists.php";
		}
	});
}
</script>
</body>
</html>